package com.mobile.weather.controller;

import com.mobile.weather.domain.WeatherResponse;
import com.mobile.weather.service.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WeatherController {

    @Autowired
    WeatherService weatherService;

    //需要写一个接口给消费者，注意遵循  restful 风格的API
    @RequestMapping("/weather/{qcity}")
    public WeatherResponse weather(@PathVariable("qcity") String city){

        return weatherService.accessThressRedisSnow(city);

    }



}
